package com.xzc.java8.A_lambda.lambda3;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class S0 {
    public static String processFile() throws IOException {
        try (BufferedReader br = new BufferedReader(new FileReader("d:/data.txt"))) {
            return br.readLine();
        }
    }

    public static String processFile(BufferedReaderProcessor p) throws IOException {
        try (BufferedReader br = new BufferedReader(new FileReader("d:/data.txt"))) {
            return p.process(br);
        }
    }

    public static void main(String[] args) throws Exception {
        System.out.println("1- " + processFile());
        System.out.println("2- " + processFile((BufferedReader br) -> br.readLine() + br.readLine()));
    }
}
